import 'package:json_annotation/json_annotation.dart';

part 'dataset.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class Transform {
  var type;
  var config;
  var print;

  Transform({this.type, this.config, this.print});

  factory Transform.fromJson(Map<String, dynamic> json) =>
      _$TransformFromJson(json);

  Map<String, dynamic> toJson() => _$TransformToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class DataSet {
  var id;
  var source;
  var dimensions;
  var sourceHeader;
  List<Transform>? transform;
  var fromDatasetIndex;
  var fromDatasetId;
  var fromTransformResult;

  DataSet(
      {this.id,
      this.source,
      this.dimensions,
      this.sourceHeader,
      this.transform,
      this.fromDatasetIndex,
      this.fromDatasetId,
      this.fromTransformResult});

  factory DataSet.fromJson(Map<String, dynamic> json) =>
      _$DataSetFromJson(json);

  Map<String, dynamic> toJson() => _$DataSetToJson(this);
}
